import { request } from "@/utils/request";
export const addToCart = (skuId, quantity = 1) => {
    return request.post("/shoppingCart", {
        skuId,
        quantity,
    });
};

export const getCartList = () => {
    return request.get("/shoppingCart", { params: { page: 1, pageSize: 99999 } });
};

export const updateCart = data => {
    return request.put("/shoppingCart", data);
};

export const deleteCart = _id => {
    return request.delete("/shoppingCart", { params: { _id } });
};

export const selectAllCart = selected => {
    return request.put("/shoppingCart/selectAll", { selected });
};
